package org.logan.sample.web.main.service.system.impl;

import java.util.List;
import org.logan.sample.db.dao.SysUserMapper;
import org.logan.sample.db.model.SysUser;
import org.logan.sample.web.base.common.Pager;
import org.logan.sample.web.main.service.system.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Desc：系统用户service实现
 * @Title：SysUserServiceImpl
 * @address: http://www.liveneo.com.cn/
 * @author: zhaoyy
 * @version: 1.0 
 * @date: 2016年11月2日 下午3:12:23
 */
@Service
public class SysUserServiceImpl implements SysUserService {
    @Autowired
    private SysUserMapper sysUserMapper;

    /**
     * 分页查询用户列表
     */
    @Override
    public void queryPager(Pager pager) {
    }

    @Override
    public SysUser queryUserByAccount(String account) {
        SysUser su = new SysUser();
        su.setUserName(account);
        su.setUserEmail(account);
        su.setUserMobile(account);
        List<SysUser> sus = sysUserMapper.selectByUserName(su);
        return null == sus ? null : sus.get(0);
    }

    @Override
    public SysUser getByUserName(String username) {
        return sysUserMapper.getByUserName(username);
    }
}
